<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>加密手机号码</title>
    <script>
      function processPhoneNumber(phoneNumber) {
        //return phoneNumber.replace(phoneNumber.substring(3, 7), '****')
        return phoneNumber.substr(0, 3) + '****' + phoneNumber.substr(7)
      }
      console.log(processPhoneNumber('18888888888'))
    </script>
  </head>
  <body></body>
</html>
